//
//  TJMessageController.h
//  XWC
//
//  Created by Hello on 2022/10/24.
//

#import <UIKit/UIKit.h>
#import "HJChatSessionModel.h"
#import "HJChatMessageLayout.h"
#import "HJChatMessageCell.h"

NS_ASSUME_NONNULL_BEGIN

@class HJMessageController;

@protocol TJMessageControllerDelegate <NSObject>

@optional

- (void)didTapInMessageController:(HJMessageController *)controller;
- (void)didHideMenuInMessageController:(HJMessageController *)controller;
- (BOOL)messageController:(HJMessageController *)controller willShowMenuInCell:(UIView *)view;
- (void)messageController:(HJMessageController *)controller onSelectMessageAvatar:(HJChatMessageCell *)cell;
- (void)messageController:(HJMessageController *)controller onLongSelectMessageAvatar:(HJChatMessageCell *)cell;
- (void)messageController:(HJMessageController *)controller onSelectMessageContent:(HJChatMessageCell *)cell;
- (void)messageController:(HJMessageController *)controller didClickRetryButton:(HJChatMessageCell *)cell;
- (void)messageControllerNeedResetInput:(HJMessageController *)controller;


@end

@interface HJMessageController : UITableViewController

@property (nonatomic, strong) NSMutableArray <HJChatMessageLayout *>*messageLayouts;
@property (nonatomic, strong) HJChatSessionModel *sessionModel;
@property (nonatomic, weak) id <TJMessageControllerDelegate> delegate;

- (void)updateMessage:(HJChatMessageLayout *)messageLayout;
- (void)addNewMessage:(HJChatMessageLayout *)messageLayout;
- (void)deleteMessage:(HJChatMessageLayout *)messageLayout;
- (void)clearAllMessge;
- (HJChatMessageModel *)getFirstMessage;

- (void)scrollToBottom:(BOOL)animate;


@end

NS_ASSUME_NONNULL_END
